package com.java.base.exercise.util;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;

/**
 * @Author RenPu
 * @Date 2021/8/14 11:00
 * @Version 1.0
 * @Description:
 **/
public class DoubleTitle {

    public static void main(String[] args) {
        double d = 4.440892098500626e-16;
        String s = String.valueOf(d);

        DecimalFormat df1 = new DecimalFormat("0.00");
        String str = df1.format(d);
        d = Math.round(d * 100) / 100;
        double abs = Math.abs(d);
        System.out.println(d + "-----------" + abs + "*******************" + str);

        System.err.println();
        System.out.println();


        double ooo = 6.661338147750939e-16;

        double bg = new BigDecimal(ooo).setScale(2, RoundingMode.UP).doubleValue();

        double abs1 = Math.abs((double) Math.round((ooo * 10) / 10));
        System.out.println(abs1);


        System.out.println((double) Math.round((ooo)) + "******************************" + "8888888888" + "&&&&&&&&&&" + bg);
    }
}
